package en.edu.scau.cmi.zhanzhiyong.carpter10;

import java.io.*;

public class Example10_4 {

	public static void main(String args[]) {
		int n = -1;
		byte a[] = new byte[100];
		
		try {
			File f = new File("happy.txt");
			FileInputStream in = new FileInputStream(f);
			
			while((n = in.read(a, 0 , 100)) != -1) {
				String s = new String(a, 0, n);
				System.out.println(s);
			}
			
			in.close();
		}
		catch(Exception e) {
			System.out.println(e);
		}
	}
}
